pp108 : enabled Property

enabled Property


Boolean that denotes whether the menu item is enabled or disabled.

Syntax

HTML

<div enabled=bValue>
...
</div>

Scripting

menuItemID.enabled [ =sValue ]


Parameters

Parameter

Description

bValue

Boolean that denotes whether the shortcut menu item is enabled or disabled.

  • true- Menu item is enabled.
  • false- Menu item is disabled.

sValue

String that denotes whether the shortcut menu item is enabled or disabled.

  • true- Menu item is enabled.
  • false- Menu item is disabled.


Example


The following example disables a shortcut menu item using the oncontext event of the shortcut menu, based on a condition.

<!-- Context menu definition inside the BODY tag -->
<div cordysType = ="wcp.library.ui.ContextMenu " id="permissions" oncontext="show()">
    <div id="readPermission">Allow Read</div>
    <div id="writePermission" enabled=false>Allow Write</div>
</div>
//Enable write permissions if the global variable "permit" is set to true
function show()
{
    if (permit == true)
    {
        var item = document.all['writePermission'];
        item.enabled = "true";
    }
}

See Also


contextmenu